package com.fzh.wangxiao.web.order.service.impl;

import com.fzh.wangxiao.utils.Result;
import com.fzh.wangxiao.web.order.controller.TBizReport;
import com.fzh.wangxiao.web.order.entity.TBizStatistics;
import com.fzh.wangxiao.web.order.service.TBizStatisticsService;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class TBizStatisticsServiceImpl  implements TBizStatisticsService {


    @Override
    public Result statistics() {
        Result result = new Result();
        TBizStatistics tBizStatistics = new TBizStatistics();
        tBizStatistics.setTotals("1000");
        tBizStatistics.setSuccess("250");
        tBizStatistics.setTotalsAmount("58000482");
        tBizStatistics.setThisMonthAmount("890541");
        result.setData(tBizStatistics);
        return result;
    }

    @Override
    public Result regReport() {
        Result result = new Result();

        List<TBizReport> reportList = new ArrayList<>();
        TBizReport bizReport = null;
        for(int i=1;i<30;i++){
            bizReport = new TBizReport();
            bizReport.setAmount((i*100)+"");
            bizReport.setTime("2020-20-"+i);
            reportList.add(bizReport);
        }
        result.setData(reportList);

        return result;
    }



    @Override
    public Result profitReport() {
        Result result = new Result();
        List<TBizReport> reportList = new ArrayList<>();
        TBizReport bizReport = null;
        for(int i=1;i<30;i++){
            bizReport = new TBizReport();
            bizReport.setAmount((i*100)+"");
            bizReport.setTime("2020-20-"+i);
            reportList.add(bizReport);
        }
        result.setData(reportList);
        return result;
    }
}
